/*package com.hy.mydesktop.shared.persistence.domain.gxt;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.extjs.gxt.ui.client.core.FastMap;
import com.extjs.gxt.ui.client.core.FastSet;
import com.extjs.gxt.ui.client.data.BaseModel;
import com.extjs.gxt.ui.client.data.BeanModelTag;
import com.google.gwt.user.client.rpc.IsSerializable;
import com.hy.mydesktop.shared.persistence.domain.gxt.constant.GxtMetaModelTypeEnum;
import com.hy.mydesktop.shared.persistence.domain.gxt.constant.LibConstants;


*//**
 * 
 * <ul>
 * <li>开发作者：花宏宇</li>
 * <li>设计日期：2010-8-27；时间：下午04:38:15</li>
 * <li>类型名称：GxtComponentMetaModel</li>
 * <li>设计目的：
 * GxtComponentMetaModel存储所以控件的元模型:分为普通结构和树形结构<br>
 * GxtComponentMetaModel迟绑定：gxtMetaModelTypeEnum用于判断GxtComponentMetaModel是属于BaseModel还是
 * 其子类TreeModel</li>
 * </ul>
 * <ul>
 * <b>修订编号：</b>
 * <li>修订日期：</li>
 * <li>修订作者：</li>
 * <li>修订原因：</li>
 * <li>修订内容：</li>
 * </ul>
 *//*
//@Entity()
@Table(name="t_gxt_Component_Controller_MetaModel")
//public class GxtComponentMetaModel  implements IsSerializable,BeanModelTag{
public class CopyOfGxtComponentControllerMetaModel9_8  extends MyBaseModel{
	
	*//**
	 * 嵌套集合为结构，存放的树形结构：以先序遍历排序内部元素
	 *//*
	private List<GxtComponentControllerMetaNodeModel> list = new ArrayList<GxtComponentControllerMetaNodeModel>();
//	private Set<GxtComponentControllerMetaNodeModel> list = new HashSet<GxtComponentControllerMetaNodeModel>();
	//private FastSet list = new FastSet();
	private FastMap<gxtComponentControllerMetaNodeModel> map = new FastMap<gxtComponentControllerMetaNodeModel>();
	
	
	public FastMap<gxtComponentControllerMetaNodeModel> getMap() {
		return map;
	}

	public void setMap(FastMap<gxtComponentControllerMetaNodeModel> map) {
		this.map = map;
	}

	public String getControllerMetaModelId() {
		return super.get(LibConstants.COMPONENT_CONTROLLER_METAMODEL_ID);
	}

	public void setControllerMetaModelId(String controllerMetaModelId) {
		super.set(LibConstants.COMPONENT_CONTROLLER_METAMODEL_ID, controllerMetaModelId);
	}
	
	//@Transient
	@OneToMany(cascade=CascadeType.ALL,fetch=FetchType.EAGER)
	@JoinColumn(name="componentControllerMetaModel_id")
	public List<GxtComponentControllerMetaNodeModel> getList() {
		return list;
	}
	
	public void setList(List<GxtComponentControllerMetaNodeModel> list) {
		this.list = list;
	}
	
	public Boolean addGxtComponentControllerMetaNodeModel(GxtComponentControllerMetaNodeModel controllerMetaNodeModel) {
		 return getList().add(controllerMetaNodeModel);
	}
	
	public int indexOf(GxtComponentControllerMetaNodeModel gxtComponentControllerMetaNodeModel) {
		return list.indexOf(gxtComponentControllerMetaNodeModel);
	}
	*//**
	 * 
	 * <ul>
	 * <li>方法含义：基于嵌套集合（先序遍历），得到当期节点在先序遍历方式洗的下一个节点</li>
	 * <li>方法作者：花宏宇</li>
	 * <li>编写日期：2010-8-29；时间：下午下午05:35:41</li>
	 * </ul>
	 * <ul>
	 * <b>修订编号：</b>
	 * <li>修订日期：</li>
	 * <li>修订作者：</li>
	 * <li>修订原因：</li>
	 * <li>修订内容：</li>
	 * </ul>
	 * @param gxtComponentControllerMetaNodeModel
	 * @return
	 *//*
	@Transient
	public GxtComponentControllerMetaNodeModel getNextNode(GxtComponentControllerMetaNodeModel gxtComponentControllerMetaNodeModel) {
		int index = list.indexOf(gxtComponentControllerMetaNodeModel);
		if (index<list.size()-1) {
			return list.get(index+1);
		} else {
			return null;
		}
		
		
	}
	
	

	@Transient
	public int getChildCount(GxtComponentControllerMetaNodeModel gxtComponentControllerMetaNodeModel) {
		return this.getChildren(gxtComponentControllerMetaNodeModel).size();
	}

	*//**
	 * 
	 * <ul>
	 * <li>方法含义：获得当前节点的所有直接子节点（通过算法，可以直接计算出子节点，而不用遍历list）</li>
	 * <li>方法作者：花宏宇</li>
	 * <li>编写日期：2010-8-29；时间：下午上午10:24:35</li>
	 * </ul>
	 * <ul>
	 * <b>修订编号：</b>
	 * <li>修订日期：</li>
	 * <li>修订作者：</li>
	 * <li>修订原因：</li>
	 * <li>修订内容：</li>
	 * </ul>
	 * @param gxtComponentControllerMetaNodeModel
	 * @return
	 *//*
	@Transient
	public List<GxtComponentControllerMetaNodeModel> getChildren(GxtComponentControllerMetaNodeModel gxtComponentControllerMetaNodeModel) {
		//TODO 需要实现获取所有直接节点
		return null;
	}

	@Transient
	public GxtComponentControllerMetaNodeModel getParent(GxtComponentControllerMetaNodeModel gxtComponentControllerMetaNodeModel) {
		//方法1
		GxtComponentControllerMetaNodeModel tempNodeModel = null;
		for (GxtComponentControllerMetaNodeModel node : list) {
			if (gxtComponentControllerMetaNodeModel.getLeftValue()>node.getLeftValue()&&
					gxtComponentControllerMetaNodeModel.getLeftValue()<node.getRightValue()) {
				tempNodeModel = node;
			}
		}
		return tempNodeModel;
		//方法2
		gxtComponentControllerMetaNodeModel tempNodeModel = null;
		int index = this.indexOf(gxtComponentControllerMetaNodeModel);
		for (int i = 0; i < index; i++) {
			if (gxtComponentControllerMetaNodeModel.getLeftValue()<list.get(i).getLeftValue()&&
					gxtComponentControllerMetaNodeModel.getLeftValue()<list.get(i).getRightValue()) {
				tempNodeModel = gxtComponentControllerMetaNodeModel;
			}
			
		}
		return tempNodeModel;
		//方法3
		gxtComponentControllerMetaNodeModel tempNodeModel = null;
		int index = this.indexOf(gxtComponentControllerMetaNodeModel);
		for (int i = index-1; i >=0 ; --i) {
			if (gxtComponentControllerMetaNodeModel.getLeftValue()<list.get(i).getLeftValue()&&
					gxtComponentControllerMetaNodeModel.getLeftValue()<list.get(i).getRightValue()) {
				tempNodeModel = gxtComponentControllerMetaNodeModel;
				return tempNodeModel;
			}
			
		}
		
		
	}
	*//**
	 * 
	 * <ul>
	 * <li>方法含义：获取树形结构（嵌套集合）的根节点</li>
	 * <li>方法作者：花宏宇</li>
	 * <li>编写日期：2010-8-29；时间：下午上午09:50:44</li>
	 * </ul>
	 * <ul>
	 * <b>修订编号：</b>
	 * <li>修订日期：</li>
	 * <li>修订作者：</li>
	 * <li>修订原因：</li>
	 * <li>修订内容：</li>
	 * </ul>
	 * @return
	 *//*
	@Transient
	public GxtComponentControllerMetaNodeModel getRoot() {
		
		return list.get(0);
		
	}
	

	*//**
	 * 
	 * <ul>
	 * <li>方法含义：判断当前节点是否为叶子节点</li>
	 * <li>方法作者：花宏宇</li>
	 * <li>编写日期：2010-8-30；时间：下午上午10:15:55</li>
	 * </ul>
	 * <ul>
	 * <b>修订编号：</b>
	 * <li>修订日期：</li>
	 * <li>修订作者：</li>
	 * <li>修订原因：</li>
	 * <li>修订内容：</li>
	 * </ul>
	 * @param gxtComponentControllerMetaNodeModel
	 * @return
	 *//*
	public boolean isLeaf(GxtComponentControllerMetaNodeModel gxtComponentControllerMetaNodeModel) {
		if (gxtComponentControllerMetaNodeModel.getLeftValue()+1==gxtComponentControllerMetaNodeModel.getRightValue()) {
			return true;
		} else {
			return false;
		}
		
	}

	
	
	*//**
	 * 
	 *//*
	//private static final long serialVersionUID = -1979950917385401561L;
	
	
	*//**
	 * 
	 * <ul>
	 * <li>方法含义：GxtComponentMetaModel的数据类型：普通控件或控件的嵌套集合</li>
	 * <li>方法作者：花宏宇</li>
	 * <li>编写日期：2010-8-29；时间：下午上午09:40:46</li>
	 * </ul>
	 * <ul>
	 * <b>修订编号：</b>
	 * <li>修订日期：</li>
	 * <li>修订作者：</li>
	 * <li>修订原因：</li>
	 * <li>修订内容：</li>
	 * </ul>
	 * @return
	 *//*
	
	@Transient
	public GxtMetaModelTypeEnum getGxtControllerMetaModelTypeEnum() {
		if (list.size()==1) {
			return GxtMetaModelTypeEnum.BASE_GXT_CONTROLLER_META_MODEL_TYPE;
		} else {
			return GxtMetaModelTypeEnum.TREE_GXT_CONTROLLER_META_MODEL_TYPE;
		}
	}
	

	*//**
	 * 构造函数
	 *//*
	public CopyOfGxtComponentControllerMetaModel9_8 ( )
	{
		super ( ) ;
		
	}

	*//**
	 * 构造函数
	 *//*
	public CopyOfGxtComponentControllerMetaModel9_8 (List<GxtComponentControllerMetaNodeModel> list )
	{	
		super();
		this.setList(list);
	}
	
	
	*//**
	 * 构造函数
	 *//*
	public GxtComponentMetaModel (FastMap<gxtComponentControllerMetaNodeModel> map  )
	{	
		super();
		this.setMap(map);
		for (String key : map.keySet()) {
			//System.err.println("List is" +this.getList());
			this.getList().add(map.get(key));
		}
	}
	
	protected void initList() {
		
	}

	
			
	
	
	

	
		
	
	
	
}*/
